How much speed is added toward `gravity_dir` every frame. It only adds speed: like `speed` and `hsp` / `vsp` it does NOT stop at walls, floors or solid objects, so an object with gravity falls straight through them. To land on something, move with `move_slide` (tiles) or `move_slide_solid` (tiles and solid objects) and set `vsp` to 0 when it stops, as the Player movement designer does, or use a Behaviors state.
gravity: realHow much speed is added toward gravity_dir every frame - a constant downward (or whatever direction you choose) acceleration, applied automatically as part of the engine's own movement phase, so you do not need to add it to vsp by hand each frame.
Accumulates cleanly whenever the instance leaves speed untouched, or keeps reasserting the exact same speed/direction every frame - see hsp's own note for the full reasoning and the one case (retargeting speed/direction to something new every frame) where it does not.
Gravity only adds speed. Like speed and hsp / vsp it does not stop at walls, floors or solid objects, so an object with gravity falls straight through them - unless the object lands on solids. Tick Lands on solids in the object's properties, or set lands_on_solids to true in code, and the object stops on solid tiles and solid objects, standing right on top of them, with on_ground saying when it is. The other way is to move with move_slide (tiles) or move_slide_solid (tiles and solid objects) and set vsp to 0 when it stops, as the Player movement designer does, or to use a Behaviors state.
gravity = 0.15;
gravity_dir = 270;A gentle constant pull toward the bottom of the screen (270 degrees), building up in vsp by 0.15 pixels a frame, every frame, until something else stops it.
Accumulates cleanly whenever the instance leaves `speed` untouched (the usual "falls under gravity, moves sideways by setting hsp directly" shape) or reasserts the exact same speed/direction every frame. A script that retargets speed/direction to something genuinely NEW every frame (chasing a moving target, say) is still telling the engine "this is my velocity now," so gravity has nothing of its own left to add on top of that - see hsp’s own note.